﻿#region File Header
//-----------------------------------------------------------------------------
// SibLib
//
// Copyright (C) 2010 Julien Villers
// This program is distributed under the terms of the 
// GNU Lesser General Public License (LGPL).
// See Docs/lgpl.txt and Docs/gpl.txt
//-----------------------------------------------------------------------------
#endregion

using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace SibLib.Render
{
    /// <summary>
    /// This is a simple view over a static (non-scrolling) 2D world.
    /// </summary>
    public class SceneInfo
    {
        public Matrix ViewMatrix
        {
            get;
            private set;
        }

        public Matrix ProjectionMatrix
        {
            get;
            private set;
        }

        public SceneInfo()
        {
            ViewMatrix = Matrix.Identity;
            ProjectionMatrix = Matrix.Identity;
        }

        public void CreateOrthoMatrices(Game game)
        {
            Viewport viewport = game.GraphicsDevice.Viewport;
            ProjectionMatrix = Matrix.CreateOrthographic(viewport.Width, viewport.Height, 0.1f, 1100.0f);
            Vector2 screenCenter = new Vector2(viewport.Width / 2.0f, viewport.Height / 2.0f);
            ViewMatrix = Matrix.CreateLookAt(new Vector3(screenCenter, -1000.0f), new Vector3(screenCenter, 0.0f), -Vector3.UnitY);
        }
    }
}
